<script>
	import config from './config'
	import {
		getToken
	} from '@/utils/auth'

	export default {
		onLaunch: function() {
			this.initApp()
		},
		methods: {
			initApp() {
				this.initConfig()
				// this.checkLogin()
				this.calc()
			},
			calc() {
				// 状态栏高度
				this.globalData.statusBarHeight = uni.getSystemInfoSync().statusBarHeight

				// #ifdef MP-WEIXIN
				// 获取微信胶囊的位置信息 width,height,top,right,left,bottom
				const custom = wx.getMenuButtonBoundingClientRect()

				this.globalData.menuBar = custom

				// 导航栏高度(标题栏高度) = 胶囊高度 + (顶部距离 - 状态栏高度) * 2
				this.globalData.navigationBarHeight = custom.height + (custom.top - this.globalData.statusBarHeight) * 2

				// 总体高度 = 状态栏高度 + 导航栏高度
				this.globalData.navHeight = this.globalData.navigationBarHeight + this.globalData.statusBarHeight

				// #endif
			},
			initConfig() {
				this.globalData.config = config
			},
		}
	}
</script>

<style lang="scss">
	@import "@/uni_modules/uview-ui/index.scss";
	@import '@/static/sqfont/iconfont.css';
	@import '@/static/industryIconfont/iconfont.css';
	@import '@/static/scss/index.scss';

	page {
		background-color: $uni-bg-color;
	}

	.gaps {
		height: 10px;
	}

	.decoration {
		width: 10px;
		height: 10px;
		margin-right: 10px;
		border-radius: 50%;
		background-color: $base_color;
	}

	.shop-item {
		padding: 10px 8px;
		display: flex;
		flex-direction: row;
		border-bottom: 1px solid #bcbcbc;
		background-color: #fff;
		border-radius: 10px;
		margin: 0 auto;
		width: 95%;
		margin-top: 8px;
		box-shadow: 0 0 2px 1px #ccc;

		&:first-child {
			margin-top: 0;
		}
	}

	.shop-content {
		display: flex;
		flex-direction: column;
		flex: 1;

		.shop-top {
			display: flex;
			flex-direction: row;
			margin-left: 10px;
			height: $shop-avatar-height;
		}

		.shop-body {
			border-top: 1px solid #bcbcbc;
			padding-top: 5px;
			margin-left: 10px;
			margin-top: 5px;
			display: flex;
			flex-direction: row;
			flex-wrap: wrap;
		}
	}

	.shop-header-content {
		flex: 1;
		display: flex;
		flex-direction: column;
		justify-content: flex-start;
		font-size: 13px;

		.shop-name {
			font-size: 15px;
			font-weight: bold;
			-webkit-line-clamp: 1;
			display: -webkit-box;
			-webkit-box-orient: vertical;
			word-break: break-all;
			overflow: hidden;
		}

		.shop-intro {
			-webkit-line-clamp: 3;
			display: -webkit-box;
			-webkit-box-orient: vertical;
			word-break: break-all;
			overflow: hidden;
		}
	}

	.shop-header-other {
		display: flex;
		flex-direction: column;
		justify-content: space-between;
		align-items: flex-end;

		.shop-tag {
			width: 50px;
			height: 50px;
			background-size: cover;

			.fanxian-text {
				color: #d81e06;
				font-size: 20px;
				font-weight: bold;
				line-height: 40px;
				text-align: center;
			}
		}

		.shop-i {
			display: flex;
			flex-direction: column;
			justify-content: flex-end;
		}
	}

	.shop-header-avatar {
		.shop-image {
			width: $shop-avatar-width;
			height: $shop-avatar-height;
			border-radius: 5px;
		}
	}
	
	.sq-panel {
		width: 95%;
		background-color: #fff;
		padding: 10px;
		border-radius: 10px;
		margin: 0 auto;
		display: flex;
		flex-direction: column;
		justify-content: flex-start;
		box-shadow: 0 0 2px 1px #ccc;
	
		.panel-tip {
			margin-bottom: 10px;
			font-weight: bold;
		}
	}
	
</style>